There are several ways to add folders to the Legend View.
Related concepts
Legend
Related reference
Legend View
Using the Legend View